/*
 * conversionservBO.java
 *
 * Created on March 31, 2007, 9:48 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package edu.byu.isys413.mystuff.printconversion;

/**
 *
 * @author Sandi Griffiths
 */
public class conversionservBO {
    
//initialize variables
    private String csid;
    private discountBO dis;
    private String type;
    private Double price; 
    private boolean dirty = false;   
    private boolean alreadyInDatabase = false;
    
    /** Creates a new instance of conversionBO */
    public conversionservBO() {
    }
        
    //creates a new instance of conversionBO
    public conversionservBO(String csid) {
        this.csid = csid;
    }
    
    //returns conversionid
    public String getCSId() {
        return csid;
    }

    //returns the id of the manager of the said store
    public discountBO getDiscount() {
        return dis;
    }

    //sets the manager id of the store bo
    public void setDiscount(discountBO dis) {
        this.dis = dis;
        setDirty(true);
    }

    public String getType(){
        return type;
    }
    
    public void setType(String type){
        this.type = type;
    }
    
    //returns store address
    public double getPrice() {
        return price;
    }

    //sets store address
    public void setPrice(double price) {
        this.price = price;
        setDirty(true);
    }

    //returns store as a string
    public String toString(){
        return "ConversionService Id: "+ this.getCSId()+" \n"+
               "Conversion Type     :"+ this.getType()+" \n"+
               "Individual price per conversion type  :" + this.getPrice()+ "\n" +
                dis.toString();
    }

    //returns if object has been changed since read or saved
    public boolean isDirty() {
        return dirty;
    }

    //sets dirty
    public void setDirty(boolean dirty) {
        this.dirty = dirty;
    }

    //returns if object is already in database
    public boolean isAlreadyInDatabase() {
        return alreadyInDatabase;
    }

    //sets if object is already in database
    public void setAlreadyInDatabase(boolean alreadyInDatabase) {
        this.alreadyInDatabase = alreadyInDatabase;
    }
}

